<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    /*
        1.工厂模式
     */
    function createPerson(name, age, job) {
        let o = new Object();
        o.name = name;
        o.age = age;
        o.job = job;
        o.sayName = function () {
            console.log(this.name)
        }
        return o;
    }
    let person1 = createPerson('jack',11,'工人')
    let person2 = createPerson('tom',12,'资本家')
    console.log(person1)    // 
    console.log(person1.constructor === Object)
</script>
</body>
</html>